php forum
php mysql forum
php mysql smarty
 
Topic Options
#231805 - 01/05/03 01:20 AM [6.2] Restore Lost Usernames to Old Posts (fix)
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
Script attached. It goes in your ubbthreads install directory, and you can delete it afterwards. [:"red"]You will require a backup from previous to the upgrade, specifically your w3t_Posts table. A new, renamed table (w3t_OldPosts) containing your old posts data is required - you will have to use PHPMyAdmin or some kind of tool or whatever to do this. Be sure and back up your current w3t_Posts table again just in case.[/] <br /> <br />I don't know if it's been noticed, but currently when you upgrade to 6.2, it deletes the Usernames from the w3t_Posts table, which means you lose the names of the people who posted stuff and had their username later deleted, because their username ID is 1 (appears as **DONOTDELETE**). <br /> <br />If you happen to have a backup of your w3t_Posts table (from 6.1.1 or earlier), with this script you can restore those lost names. You need to Restore your backup as w3t_OldPosts, then execute the script. <br /> <br />What it does is it grabs all posts that have been posted by Registed Users with the ID of 1, which means they were deleted. It takes their Username from the old table, and places it in the AnonName from the new table, and reflags them as unregistered posters. <br /> <br />When I ran it, it went through about 10,000 posts, and for some reason, some names could not be restored. Most were, though. Probably 90%. YMMV, but it's better than having **DONOTDELETE** everywhere. <br /> <br />If there are problems that you encounter, I'll watch this thread for replies. <br /> <br />Thanks! <br /> <br />ps. -demo of the result here: http://www.legendsoftacendia.com/forums/...amp;amp;fpart=1


Attachments
63662-fix.php.txt (28 downloads)



Edited by Dalar (01/06/03 06:16 PM)
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#231806 - 01/06/03 03:49 AM Re: [6.2] Restore Lost Usernames to Old Posts (fix) [Re: beatdown]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
I should add that I've discovered this does not happen to everyone. So, it's not a bugfix everyone will find useful, but for those few that had my prob, it should help.
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#231807 - 01/06/03 04:19 AM Re: [6.2] Restore Lost Usernames to Old Posts (fix [Re: beatdown]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
Dalar, can you [:"red"] highlight in RED in your instructions that the old data has to be restored to a NEW table under a NEW name [/] and therefore the data file has to be edited at all ocurrences, where it says "w3t_post", to "w3t_post_old"? - I almost screwed up with this one. <img src="/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />And what about those indexes. Do they have to be renamed in the "Old" file too? Or does it not matter when w3t_post" and "w3t_post_old" use same KEY names... (This is beyond my MySql knowledge) <img src="/forum/images/graemlins/smile.gif" alt="" /> <br />But I think, at least it cannot hurt, changing all those names into something else doo.. <br /> <br />To complete your script, the OLD table should be dropped thereafter. Or you carry tons of now useless information in the database. <br /> <br />I think I'll give your hack a try today! - Maybe this one is about to save me hours of debats with irritated suspicious users who think that some type of big brother admin was not only killing users here but also killing their entire pasts... <img src="/forum/images/graemlins/wink.gif" alt="" /> <img src="/forum/images/graemlins/wink.gif" alt="" /> <br /> <br /> <br />


Edited by caymuc (01/06/03 05:30 AM)
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#231808 - 01/06/03 06:06 AM Re: [6.2] Restore Lost Usernames to Old Posts (fix [Re: rodrigo1]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
I did everything and ran the script. <br />Then I checked for the result with PHP MY ADMIN. <br />OK, the names got put into the Anon-Field. And in those cases the Reg. field was "n". <br /> <br />But opening a thread in Threads (flat mode) shows the Poster-Entry in the summary-table in such a case empty. Ok, I open on of those posts and see that on the left side there is "non registered" written but nothing else: The Anon Name seems not to be displayed. So there is still a problem somewhere? <br /> <br />I have set: "unregistered username allowed and displayed": YES <br />
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#231809 - 01/06/03 02:53 PM Re: [6.2] Restore Lost Usernames to Old Posts (fix [Re: rodrigo1]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
Hmm.. I'll have to check my forum settings to see if anything else is required.
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#231810 - 01/06/03 02:56 PM Re: [6.2] Restore Lost Usernames to Old Posts (fix [Re: rodrigo1]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
Will do in a moment, thanks for the advice.<br /><br />I didn't include a drop table, because I assumed anyone that would use this would also being using PHPmyAdmin or some other tool to restore the w3t_Posts_old that they'd again be able to use to drop said table. <br /><br />I'll rewrite it a bit to make up for a couple of these issues.
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#231811 - 01/06/03 03:09 PM Updated the script [Re: beatdown]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
I've updated the script to accept any prefix, and changed the table name of the old posts to w3t_OldPosts so that there's no confusion.<br /><br />Hope this helps.
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#231812 - 01/06/03 04:07 PM Re: Updated the script [Re: beatdown]
xyzyzzyx Offline
Lurker

Registered: 12/11/02
Posts: 4
Is the updated script the link at the beginning of the thread?<br /><br />Also is it 100% now? This is a lifesaver for me! <img src="/forum/images/graemlins/cool.gif" alt="" />

Top
#231813 - 01/06/03 05:33 PM Re: Updated the script [Re: nephilim]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
Not sure if it's 100% now. Just a code cleanup - I have my suspicions on what caused the few names that vanished to vanish.<br /><br />Anhyhoo, I'll investigate a bit tonight.
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#231814 - 01/06/03 06:04 PM Re: Updated the script [Re: beatdown]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
I found what had caused some names to dissapear on my forum.<br /><br />When I first tried to upload a backup to the web, PHPMyAdmin couldn't handle it - 7 MB of POST data exceeds the maximum or something. So I cut down the backup on my computer to just those posts that were posted by those with registered usernames with PosterID of '1'.<br /><br />What I didn't realise until now, is that the backup I was using was old by about a month, which shouldn't matter when the posts I was concerned about were over a year old, except for the fact that I had deleted some users after this backup was done. So, that meant that when the script checked for one user that was recently deleted, it would find the correct condition to grab the username, except that the corresponding post wasn't even in the backup database because I had weeded out all registered users.<br /><br />So, if you have a full backup table, all should be fine. In my case, it was lacking, and it would just stick nullspace in the AnonName. My bad.. shouldn't affect others' results though.<br /><br />Carl, fromw hat I recall the setting for anon users should not matter. Either on or off, if it encounters something in the database recorded as an Anon it'll treat it as one. Are the B_Reged lines right?
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks